
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<c:set var="listorders" scope="request"
	value="${requestScope.listorders}" />
<c:choose>
	<c:when test="${listorders.size() > 0}">
		<form name="listorder" action="UpdateOrderUser.do" method="get">
			<table width="100%" border="1" cellspacing="0" cellpadding="5">
				<tr bgcolor="#666666">
					<td class="bgColorMain"><strong><font color="#FFFFFF">LIST
								ORDER</font></strong>
						<div class="filterorder" style="text-align: right">
							<label style="font-size: 16px;" for="Sortby">Filter:</label> 
							<select name="filterorder" onchange="submit()">
								<option
									<c:if test="${filterorder == -1}">
			                                selected="selected" 
			                            </c:if>
									value="-1">ALL DAY</option>
								<c:forEach var="i" begin="0" end="${listfilter.size()- 1 }">
									<option 
										<c:if test="${i == filterorder}">
			                                selected="selected" 
			                            </c:if>
									value="${i}">${listfilter[i]}</option>
								</c:forEach>
							</select>
						</div>
					</td>
				</tr>
				<tr>
					<td>
						<table width="100%" border="1" cellspacing="0" cellpadding="5">
							<tr align="center" bgcolor="#999999">
								<td><strong>ORDER ID</strong></td>
								<td><strong>USER</strong></td>
								<td><strong>ORDER STATUS</strong></td>
								<td><strong>TOTAL MONEY</strong></td>
								<td><strong>DATE</strong></td>
								<td><strong>DETAIL</strong></td>
							</tr>
							<c:if test="${listorders.size() > 0}">
								<c:forEach var="i" begin="0" end="${listorders.size()-1}">
									<c:set var="ord" value="${listorders[i]}" />
									<tr valign="top">
										<td align="center">${ord.orderid }</td>
										<td align="center">${ord.user.email }</td>
										<td align="center">${ord.orderstatus.orderstatusname}</td>
										<td align="center">${ord.totalmoney}$</td>
										<td align="center">${ord.orderdate}</td>
										<td align="center"><a
											href="ViewOrderDetail.do?orderid=${ord.orderid}">View
												Details</a></td>
									</tr>
								</c:forEach>
							</c:if>
						</table> <br />
						<table width="100%">
							<tr valign="top">
								<td align="center"><a href="DownloadOrder.do"><img src="images/btDownload.png" alt="#" border="0" /></a></td>
							</tr>
						</table>

					</td>
				</tr>
			</table>
		</form>
	</c:when>

	<c:otherwise>
		<table width="100%" border="1" cellspacing="0" cellpadding="5">
			<tr bgcolor="#666666">
				<td class="bgColorMain"><strong><font color="#FFFFFF">No
							Order in List! Press <a style="color: red" href="UserDetail.do">here</a>
							to back manage account!
					</font></strong></td>
			</tr>
		</table>
	</c:otherwise>
</c:choose>